#ifndef CIRCLEDEP_H
#define CIRCLEDEP_H

#include <QGraphicsItem>
#include "myshape.h"
#include "xmlNode.h"
#include "xmlObj.h"
#include "node.h"

class designer;

class circleDep : public QObject, public myshape{

    Q_OBJECT

public:
    circleDep(designer *d);
    ~circleDep();

    QRectF boundingRect() const;
    QPainterPath shape() const;
    void paint(QPainter *painter,const QStyleOptionGraphicsItem *option, QWidget *widget);
    void setReaction(node *reaction);
    node *getReaction();
    //void setDepList(QList<dep *> *depList);
    //QList<dep *> *getDepList();
    void setDepIsLonely(xmlDep * value);
    xmlDep *getDepIsLonely();
    void setIsDeleteCircleDep(bool value);
    bool getIsDeleteCircleDep();

    void setIsSet(bool value);
    bool getIsSet();

    QString getLogicConditionalDep();
    void setLogicConditionalDep(QString value);
    void setIdNumber(int value);
    int getIdNumber();

protected:
    void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
    //void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);

private:
    QRectF outlineRect() const; //ritorna il rettangolo disegnato
    int roundness(double size) const;
    node * reaction;
    //QList<dep *> *depList;
    xmlDep *depIsLonely;//dipendenza associata al circleDep
    designer *myDesigner;
    bool isDeleteCircleDep;//per sapere se devo richiamare la cancellazione del circleDep quando cancello una dip isLonely
private:
    int idNumber; //numero cidentificato per distingure i vari circleDep del reaction
    bool isSet;
    QString logicalConditionDep;
private slots:
    void deleteCircleDep();

};




#endif // CIRCLEDEP_H
